package com.xb.loan.util.rpc.dubbo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DubboServerUtil {

	public static ClassPathXmlApplicationContext context = null;
	
	public static void init(ApplicationContext parentContext){
		context = new ClassPathXmlApplicationContext("classpath:META-INF/applicationProvider.xml"); 
		context.setParent(parentContext);
		context.start();
	}
	
	public static Object getBean(String key){
		return context.getBean(key); 
	}
}
